// Quantitative Angiogram Analysis System
//
// Copyright ?Ping Zou, 2006
// sg71.cherub@gmail.com

using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.Drawing.Printing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;

using WeifenLuo.WinFormsUI;
using eee.Sheffield.PZ.Imaging;
using eee.Sheffield.PZ.Imaging.ImageIO;

namespace eee.Sheffield.PZ.QAAS
{
    /// <summary>
    /// class MainForm menu item events
    /// </summary>
    partial class MainForm
    {
        /// <summary>
        /// File -> Open Image
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void openImageToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenImage();
        }

        /// <summary>
        /// File -> Save Image
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void saveImageToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SaveImage();
        }

        /// <summary>
        /// View -> Log
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void logToolStripMenuItem_Click(object sender, EventArgs e)
        {
            configuration.showLogForm = ((ToolStripMenuItem)sender).Checked;
            ShowLogForm();
            logForm.DockState = configuration.showLogForm ? DockState.DockBottom : DockState.DockBottomAutoHide;
            // log
            string logText = ((ToolStripMenuItem)sender).Checked ? "Log form shows." : "Log form hides";
            Log(logText);
        }

        /// <summary>
        /// View -> Histogram
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void histogramToolStripMenuItem_Click(object sender, EventArgs e)
        {
            configuration.showHistogramForm = ((ToolStripMenuItem)sender).Checked;
            ShowHistogramForm();
            histogramForm.DockState = configuration.showHistogramForm ? DockState.DockRight : DockState.DockRightAutoHide;           
            // log
            string logText = configuration.showHistogramForm ? "Histogram form shows." : "Histogram form hides";
            Log(logText);          
        }

        /// <summary>
        /// View -> Filter Settings
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void filterSettingsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            configuration.showFilterForm = ((ToolStripMenuItem)sender).Checked;
            ShowFilterForm();            
            filterForm.DockState = configuration.showFilterForm ? DockState.DockRight : DockState.DockRightAutoHide;
            // log
            string logText = configuration.showFilterForm ? "Filter form shows." : "Filter form hides";
            Log(logText);
        }

        /// <summary>
        /// File -> Auto Save Log
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void autoSaveLogToolStripMenuItem_Click(object sender, EventArgs e)
        {
            configuration.autoSaveLog = ((ToolStripMenuItem)sender).Checked;
            // log
            string logText = configuration.autoSaveLog ? "Auto Log Save is enabled." : "Auto Log Save is disabled.";
            Log(logText);
        }
    }
}
